<?php
/**
 * This file is part of PHPlaza (xhttp://code.google.com/p/phplaza)
 * This file is licensed under the GNU Lesser General Public License
 *      http://www.gnu.org/licenses/lgpl.html
 *
 * No warranty is given, express or implied. Use at your own risk.
 */
 
namespace core::components;

class State implements ArrayAccess
{
	private $state;
	
	public function __construct()
	{
		$this->state = new core::collections::CList();
	}
	
	public function offsetExists($offset)
	{
		return isset($this->state[$offset]);
	}
	
	public function offsetGet($offset)
	{
		return $this->state[$offset];
	}
	
	public function offsetSet($offset, $value)
	{
		$this->state[$offset] = $value;
	}
	
	public function offsetUnset($offset)
	{
		unset($this->state[$offset]);
	}
}